<?php
/* Creates new connection to the MySQL server
 * and returns it;
 * $currentConnection = CreateNewDBConnection();
 */
function CreateNewDBConnection() 
{
    $dbHost = "localhost";
    $dbUser = "mars";
    $dbPassword = "XXXXXX";
    $dbDatabase = "mars";

    $con = new mysqli($dbHost, $dbUser, $dbPassword, $dbDatabase);

    // Check connection
    if ($con->connect_errno) 
    {
        printf("Connect failed: %s\n", $mysqli->connect_error);
        exit();
    }
    else
    { 
        printf("<br>Connection successful!"); 
    }

    return $con;
}
?>